﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;

using ConstructionBidOnline.Biz;
public partial class admin_AdminMaster : System.Web.UI.MasterPage
{

    #region Event Handlers

    #region Page Load

    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["username"] == null)
            Response.Redirect("sessionexpire.aspx");
          SubAdmin logediduser = SubAdmin.GetUserByUserLogin(Session["username"].ToString());
          foreach(SubAdminRole obj in logediduser.Roles)
          {
              HideAndSeekMenu(obj.RoleName);
          }
    }

    #endregion 

    #endregion

    #region Privates

    private void HideAndSeekMenu(string rolename)
    {
        switch (rolename)
        {
            case "Site Administrator":
                //licountry.Visible = true;
                listate.Visible = true;
                licity.Visible = true;
                lizipcode.Visible = true;
                lisubadmin.Visible = true;
                liroles.Visible = true;
                liBusinesscategory.Visible = true;
                liBusinesssubcategory.Visible = true;
                lijobcategory.Visible = true;
                lijobsubcategory.Visible = true;
                liemailcategory.Visible = true;
                liemaillayout.Visible = true;
                lidisputecategory.Visible = true;
                lidisputesubcategory.Visible = true;
                lipagecontent.Visible = true;
                liFAQs.Visible = true;
                livideo.Visible = true;
                litestimonials.Visible = true;
                lijobs.Visible = true;
                //limessages.Visible = true;
                //lidispute.Visible = true;
                lidirectory.Visible = true;
                //lipayment.Visible = true;
                liconsultant.Visible = true;
                libuyer.Visible = true;
                licontractor.Visible = true;
                libid.Visible = true;
                //lijoblisting.Visible = true;
                //liFTP.Visible = true;
                //likeywords.Visible = true;
                lisettings.Visible = true;
                lipressrelease.Visible = true;
                liuserfeedback.Visible = true;
                break;
            case "Manage Location":
                //licountry.Visible = true;
                //listate.Visible = true;
                //licity.Visible = true;
                //lizipcode.Visible = true;
                break;
            case "Manage Sub-Admin":
                lisubadmin.Visible = true;
                break;
            case "Manage Roles":
                liroles.Visible = true;
                break;
            case "Manage Business Category":
                liBusinesscategory.Visible = true;
                break;
            case "Manage Business Sub-category":
                liBusinesssubcategory.Visible = true;
                break;
            case "Manage Job Category":
                lijobcategory.Visible = true;
                break;
            case "Manage Job Sub-Category":
                lijobsubcategory.Visible = true;
                break;
            case "Manage Email Category":
                liemailcategory.Visible = true;
                break;
            case "Manage Email Layout":
                liemaillayout.Visible = true;
                break;
            case "Manage Dispute Category":
                lidisputecategory.Visible = true;
                break;
            case "Manage Dispute Sub-Category":
                lidisputesubcategory.Visible = true;
                break;
            case "Manage Page Contents":
                lipagecontent.Visible = true;
                break;
            case "Manage FAQs and Help":
                liFAQs.Visible = true;
                break;
            case "Manage Video":
                livideo.Visible = true;
                break;
            case "Manage Testimonials":
                litestimonials.Visible = true;
                break;
            case "Manage Consultants":
                liconsultant.Visible = true;
                break;
            case "Manage Buyer":
                libuyer.Visible = true;
                break;
            case "Manage Jobs":
                lijobs.Visible = true;
                break;
            case "Directory":
                lidirectory.Visible = true;
                break;
            case "Settings":
                lisettings.Visible = true;  
                break;
            case "Press Release":
                lipressrelease.Visible = true;
                break;
            case "FeedBacks":
                liuserfeedback.Visible = true;
            break;
                

        }
    
    }

    #endregion

}
